﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace Grizzy_X
{
    public class CPointLegend : CLegend
    {
        public enum PointStyle { circle, filled_circle, triangle, filled_triangle, rectangle, filled_rectangle };
        public PointStyle Point_Style;
        public Color color;
        //！！！！！注意尺寸应该在输入时有个上限值！！！！！！
        public float size;//默认为点图例外接正方形的边长，单位为像素
        public Bitmap cpointlegend;//在点图例中存储点图例的bitmap，方便画图

        public void initialize()
        {
            this.size = (float)10;
            this.color = Color.DarkOrange;
            this.Point_Style = CPointLegend.PointStyle.filled_circle;
            this.Legend_Type = LegendType.CPointLegend;
            this.cpointlegend = new Bitmap((int)this.size + 2, (int)this.size + 2);//画笔默认为两个像素的宽度
            Graphics gra = Graphics.FromImage(this.cpointlegend);
            SolidBrush brush = new SolidBrush(this.color);
            gra.FillEllipse(brush, 0, 0, this.size, this.size);
            this.ByScale = true;
            this.Visible = true;
        }
    }
}
